<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/html" xmlns="http://www.w3.org/1999/html">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Code Editor with Highlight</title>
    <link rel="stylesheet" href="__ROOT__/static/plugs/layui/css/layui.css?at={:date('md')}">
</head>
<body>

    <div class="layui-collapse">

        {foreach $employ_info as $item}
        <div class="layui-colla-item">
            <div class="layui-colla-title">{$item.title}</div>

            {if isset($item['sub']) }
            {foreach $item.sub as $k => $vo}
            <div class="layui-colla-content">
                <p  class="open-window" onclick="abc(this)" data-url="{:url('index')}?employ_id={$employ_id}&task_id={$task_id}&employ_info_id={$vo.id}">第{$k+1}关： {$vo.title}</p>
            </div>
            {/foreach}
            {/if}
        </div>
        {/foreach}

    </div>

<script src="__ROOT__/static/plugs/layui/layui.js"></script>
<script src="__ROOT__/static/plugs/web_edit/js/jquery.min.js"></script>
    <script>

        function abc(obj) {

            let index = parent.layer.getFrameIndex(window.name); // 先得到当前 iframe 层的索引
            parent.layer.close(index); //

            let url = $(obj).attr('data-url');
            console.log(url);
            parent.aaa(url);
        }

    </script>
</body>
</html>